3.3.31 \(\int \frac {d+e x+f x^2}{(g+h x)^2 \sqrt {a+b x+c x^2}} \, dx\) [231]

Optimal. Leaf size=241 \[ -\frac {\left (f g^2-h (e g-d h)\right ) \sqrt {a+b x+c x^2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}+\frac {f \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{\sqrt {c} h^2}-\frac {\left (2 c \left (f g^3-d g h^2\right )+h \left (2 a h (2 f g-e h)-b \left (3 f g^2-e g h-d h^2\right )\right )\right ) \tanh ^{-1}\left (\frac {b g-2 a h+(2 c g-b h) x}{2 \sqrt {c g^2-b g h+a h^2} \sqrt {a+b x+c x^2}}\right )}{2 h^2 \left (c g^2-b g h+a h^2\right )^{3/2}} \]

[Out]

-1/2*(2*c*(-d*g*h^2+f*g^3)+h*(2*a*h*(-e*h+2*f*g)-b*(-d*h^2-e*g*h+3*f*g^2)))*arctanh(1/2*(b*g-2*a*h+(-b*h+2*c*g
)*x)/(a*h^2-b*g*h+c*g^2)^(1/2)/(c*x^2+b*x+a)^(1/2))/h^2/(a*h^2-b*g*h+c*g^2)^(3/2)+f*arctanh(1/2*(2*c*x+b)/c^(1
/2)/(c*x^2+b*x+a)^(1/2))/h^2/c^(1/2)-(f*g^2-h*(-d*h+e*g))*(c*x^2+b*x+a)^(1/2)/h/(a*h^2-b*g*h+c*g^2)/(h*x+g)

________________________________________________________________________________________

Rubi [A]
time = 0.22, antiderivative size = 239, normalized size of antiderivative = 0.99, number of steps used = 6, number of rules used = 5, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.156, Rules used = {1664, 857, 635, 212, 738} \begin {gather*} -\frac {\sqrt {a+b x+c x^2} \left (f g^2-h (e g-d h)\right )}{h (g+h x) \left (a h^2-b g h+c g^2\right )}-\frac {\tanh ^{-1}\left (\frac {-2 a h+x (2 c g-b h)+b g}{2 \sqrt {a+b x+c x^2} \sqrt {a h^2-b g h+c g^2}}\right ) \left (2 c \left (f g^3-d g h^2\right )-h \left (-2 a h (2 f g-e h)-b h (d h+e g)+3 b f g^2\right )\right )}{2 h^2 \left (a h^2-b g h+c g^2\right )^{3/2}}+\frac {f \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{\sqrt {c} h^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d + e*x + f*x^2)/((g + h*x)^2*Sqrt[a + b*x + c*x^2]),x]

[Out]

-(((f*g^2 - h*(e*g - d*h))*Sqrt[a + b*x + c*x^2])/(h*(c*g^2 - b*g*h + a*h^2)*(g + h*x))) + (f*ArcTanh[(b + 2*c
*x)/(2*Sqrt[c]*Sqrt[a + b*x + c*x^2])])/(Sqrt[c]*h^2) - ((2*c*(f*g^3 - d*g*h^2) - h*(3*b*f*g^2 - b*h*(e*g + d*
h) - 2*a*h*(2*f*g - e*h)))*ArcTanh[(b*g - 2*a*h + (2*c*g - b*h)*x)/(2*Sqrt[c*g^2 - b*g*h + a*h^2]*Sqrt[a + b*x
 + c*x^2])])/(2*h^2*(c*g^2 - b*g*h + a*h^2)^(3/2))

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 635

Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(4*c - x^2), x], x, (b + 2*c*x)
/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 738

Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Dist[-2, Subst[Int[1/(4*c*d
^2 - 4*b*d*e + 4*a*e^2 - x^2), x], x, (2*a*e - b*d - (2*c*d - b*e)*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a,
b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[2*c*d - b*e, 0]

Rule 857

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Dis
t[g/e, Int[(d + e*x)^(m + 1)*(a + b*x + c*x^2)^p, x], x] + Dist[(e*f - d*g)/e, Int[(d + e*x)^m*(a + b*x + c*x^
2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0]
&&  !IGtQ[m, 0]

Rule 1664

Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = Polynomia
lQuotient[Pq, d + e*x, x], R = PolynomialRemainder[Pq, d + e*x, x]}, Simp[(e*R*(d + e*x)^(m + 1)*(a + b*x + c*
x^2)^(p + 1))/((m + 1)*(c*d^2 - b*d*e + a*e^2)), x] + Dist[1/((m + 1)*(c*d^2 - b*d*e + a*e^2)), Int[(d + e*x)^
(m + 1)*(a + b*x + c*x^2)^p*ExpandToSum[(m + 1)*(c*d^2 - b*d*e + a*e^2)*Q + c*d*R*(m + 1) - b*e*R*(m + p + 2)
- c*e*R*(m + 2*p + 3)*x, x], x], x]] /; FreeQ[{a, b, c, d, e, p}, x] && PolyQ[Pq, x] && NeQ[b^2 - 4*a*c, 0] &&
 NeQ[c*d^2 - b*d*e + a*e^2, 0] && LtQ[m, -1]

Rubi steps

\begin {align*} \int \frac {d+e x+f x^2}{(g+h x)^2 \sqrt {a+b x+c x^2}} \, dx &=-\frac {\left (f g^2-h (e g-d h)\right ) \sqrt {a+b x+c x^2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}-\frac {\int \frac {\frac {1}{2} \left (-2 c d g+b e g+2 a f g-\frac {b f g^2}{h}+b d h-2 a e h\right )+f \left (b g-\frac {c g^2}{h}-a h\right ) x}{(g+h x) \sqrt {a+b x+c x^2}} \, dx}{c g^2-b g h+a h^2}\\ &=-\frac {\left (f g^2-h (e g-d h)\right ) \sqrt {a+b x+c x^2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}+\frac {f \int \frac {1}{\sqrt {a+b x+c x^2}} \, dx}{h^2}-\frac {\left (2 c \left (f g^3-d g h^2\right )-h \left (3 b f g^2-b h (e g+d h)-2 a h (2 f g-e h)\right )\right ) \int \frac {1}{(g+h x) \sqrt {a+b x+c x^2}} \, dx}{2 h^2 \left (c g^2-b g h+a h^2\right )}\\ &=-\frac {\left (f g^2-h (e g-d h)\right ) \sqrt {a+b x+c x^2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}+\frac {(2 f) \text {Subst}\left (\int \frac {1}{4 c-x^2} \, dx,x,\frac {b+2 c x}{\sqrt {a+b x+c x^2}}\right )}{h^2}+\frac {\left (2 c \left (f g^3-d g h^2\right )-h \left (3 b f g^2-b h (e g+d h)-2 a h (2 f g-e h)\right )\right ) \text {Subst}\left (\int \frac {1}{4 c g^2-4 b g h+4 a h^2-x^2} \, dx,x,\frac {-b g+2 a h-(2 c g-b h) x}{\sqrt {a+b x+c x^2}}\right )}{h^2 \left (c g^2-b g h+a h^2\right )}\\ &=-\frac {\left (f g^2-h (e g-d h)\right ) \sqrt {a+b x+c x^2}}{h \left (c g^2-b g h+a h^2\right ) (g+h x)}+\frac {f \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{\sqrt {c} h^2}-\frac {\left (2 c \left (f g^3-d g h^2\right )-h \left (3 b f g^2-b h (e g+d h)-2 a h (2 f g-e h)\right )\right ) \tanh ^{-1}\left (\frac {b g-2 a h+(2 c g-b h) x}{2 \sqrt {c g^2-b g h+a h^2} \sqrt {a+b x+c x^2}}\right )}{2 h^2 \left (c g^2-b g h+a h^2\right )^{3/2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 1.24, size = 236, normalized size = 0.98 \begin {gather*} -\frac {\frac {h \left (f g^2+h (-e g+d h)\right ) \sqrt {a+x (b+c x)}}{\left (c g^2+h (-b g+a h)\right ) (g+h x)}+\frac {\sqrt {-c g^2+h (b g-a h)} \left (2 c \left (f g^3-d g h^2\right )+h \left (-3 b f g^2+b h (e g+d h)-2 a h (-2 f g+e h)\right )\right ) \tan ^{-1}\left (\frac {\sqrt {c} (g+h x)-h \sqrt {a+x (b+c x)}}{\sqrt {-c g^2+h (b g-a h)}}\right )}{\left (c g^2+h (-b g+a h)\right )^2}+\frac {f \log \left (b+2 c x-2 \sqrt {c} \sqrt {a+x (b+c x)}\right )}{\sqrt {c}}}{h^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(d + e*x + f*x^2)/((g + h*x)^2*Sqrt[a + b*x + c*x^2]),x]

[Out]

-(((h*(f*g^2 + h*(-(e*g) + d*h))*Sqrt[a + x*(b + c*x)])/((c*g^2 + h*(-(b*g) + a*h))*(g + h*x)) + (Sqrt[-(c*g^2
) + h*(b*g - a*h)]*(2*c*(f*g^3 - d*g*h^2) + h*(-3*b*f*g^2 + b*h*(e*g + d*h) - 2*a*h*(-2*f*g + e*h)))*ArcTan[(S
qrt[c]*(g + h*x) - h*Sqrt[a + x*(b + c*x)])/Sqrt[-(c*g^2) + h*(b*g - a*h)]])/(c*g^2 + h*(-(b*g) + a*h))^2 + (f
*Log[b + 2*c*x - 2*Sqrt[c]*Sqrt[a + x*(b + c*x)]])/Sqrt[c])/h^2)

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(484\) vs. \(2(221)=442\).
time = 0.13, size = 485, normalized size = 2.01

method result size
default \(\frac {f \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{h^{2} \sqrt {c}}-\frac {\left (e h -2 g f \right ) \ln \left (\frac {\frac {2 a \,h^{2}-2 b g h +2 c \,g^{2}}{h^{2}}+\frac {\left (b h -2 c g \right ) \left (x +\frac {g}{h}\right )}{h}+2 \sqrt {\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}\, \sqrt {\left (x +\frac {g}{h}\right )^{2} c +\frac {\left (b h -2 c g \right ) \left (x +\frac {g}{h}\right )}{h}+\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}}{x +\frac {g}{h}}\right )}{h^{3} \sqrt {\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}}+\frac {\left (d \,h^{2}-e g h +f \,g^{2}\right ) \left (-\frac {h^{2} \sqrt {\left (x +\frac {g}{h}\right )^{2} c +\frac {\left (b h -2 c g \right ) \left (x +\frac {g}{h}\right )}{h}+\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}}{\left (a \,h^{2}-b g h +c \,g^{2}\right ) \left (x +\frac {g}{h}\right )}+\frac {\left (b h -2 c g \right ) h \ln \left (\frac {\frac {2 a \,h^{2}-2 b g h +2 c \,g^{2}}{h^{2}}+\frac {\left (b h -2 c g \right ) \left (x +\frac {g}{h}\right )}{h}+2 \sqrt {\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}\, \sqrt {\left (x +\frac {g}{h}\right )^{2} c +\frac {\left (b h -2 c g \right ) \left (x +\frac {g}{h}\right )}{h}+\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}}{x +\frac {g}{h}}\right )}{2 \left (a \,h^{2}-b g h +c \,g^{2}\right ) \sqrt {\frac {a \,h^{2}-b g h +c \,g^{2}}{h^{2}}}}\right )}{h^{4}}\) \(485\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f*x^2+e*x+d)/(h*x+g)^2/(c*x^2+b*x+a)^(1/2),x,method=_RETURNVERBOSE)

[Out]

f/h^2*ln((1/2*b+c*x)/c^(1/2)+(c*x^2+b*x+a)^(1/2))/c^(1/2)-1/h^3*(e*h-2*f*g)/((a*h^2-b*g*h+c*g^2)/h^2)^(1/2)*ln
((2*(a*h^2-b*g*h+c*g^2)/h^2+(b*h-2*c*g)/h*(x+1/h*g)+2*((a*h^2-b*g*h+c*g^2)/h^2)^(1/2)*((x+1/h*g)^2*c+(b*h-2*c*
g)/h*(x+1/h*g)+(a*h^2-b*g*h+c*g^2)/h^2)^(1/2))/(x+1/h*g))+1/h^4*(d*h^2-e*g*h+f*g^2)*(-1/(a*h^2-b*g*h+c*g^2)*h^
2/(x+1/h*g)*((x+1/h*g)^2*c+(b*h-2*c*g)/h*(x+1/h*g)+(a*h^2-b*g*h+c*g^2)/h^2)^(1/2)+1/2*(b*h-2*c*g)*h/(a*h^2-b*g
*h+c*g^2)/((a*h^2-b*g*h+c*g^2)/h^2)^(1/2)*ln((2*(a*h^2-b*g*h+c*g^2)/h^2+(b*h-2*c*g)/h*(x+1/h*g)+2*((a*h^2-b*g*
h+c*g^2)/h^2)^(1/2)*((x+1/h*g)^2*c+(b*h-2*c*g)/h*(x+1/h*g)+(a*h^2-b*g*h+c*g^2)/h^2)^(1/2))/(x+1/h*g)))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(h*x+g)^2/(c*x^2+b*x+a)^(1/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume((b/h-(2*c*g)/h^2)^2>0)', see `
assume?` for

________________________________________________________________________________________

Fricas [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(h*x+g)^2/(c*x^2+b*x+a)^(1/2),x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {d + e x + f x^{2}}{\left (g + h x\right )^{2} \sqrt {a + b x + c x^{2}}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x**2+e*x+d)/(h*x+g)**2/(c*x**2+b*x+a)**(1/2),x)

[Out]

Integral((d + e*x + f*x**2)/((g + h*x)**2*sqrt(a + b*x + c*x**2)), x)

________________________________________________________________________________________

Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x^2+e*x+d)/(h*x+g)^2/(c*x^2+b*x+a)^(1/2),x, algorithm="giac")

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,sageVARx):;OUTP
UT:Warning, integration of abs or sign assumes constant sign by intervals (correct if the argument is real):Ch
eck [abs(t_

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {f\,x^2+e\,x+d}{{\left (g+h\,x\right )}^2\,\sqrt {c\,x^2+b\,x+a}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d + e*x + f*x^2)/((g + h*x)^2*(a + b*x + c*x^2)^(1/2)),x)

[Out]

int((d + e*x + f*x^2)/((g + h*x)^2*(a + b*x + c*x^2)^(1/2)), x)

________________________________________________________________________________________